#ifndef INPUTITERATOR_H_INCLUDED
#define INPUTITERATOR_H_INCLUDED

#include "inputelement.h"

//#define NDEBUG
#include <assert.h>

class InputIterator {
    private:
        InputElement*& elements;
        const unsigned int& sizeOfElements;
        unsigned int currentPosition;
    public:
        InputIterator(InputElement*& inputElements, const unsigned int& size);
        // constructor
        inline void reset() { currentPosition=0; };
        // sets currentPosition to 0
        inline bool hasNext() { return currentPosition<sizeOfElements; };
        // returns false if reached end, true otherwise
        inline InputElement& getNext() {
            assert(hasNext());
            return elements[currentPosition++]; };
        // returns next element and increases currentPosition
        inline bool wasReseted() {  return currentPosition==0;  };
        // checks wheter the Iterator was reseted (assertion reasons)
        ~InputIterator();
        // empty destrcutor
};

#endif // INPUTITERATOR_H_INCLUDED
